package com.ljx.excel.component;

import com.ljx.excel.domain.User;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2025-08-18  21:40
 */
public class UserRowMapper implements RowMapper<User> {

    @Override
    public User mapRow(ResultSet rs, int rowNum) throws SQLException {
        User user = new User();
        user.setId(rs.getLong("id"));
        user.setUsername(rs.getString("username"));
        user.setSex(rs.getInt("sex"));
        user.setIntroduce(rs.getString("introduce"));
        user.setIp(rs.getString("ip"));
        user.setCreateTime(rs.getDate("create_time"));
        user.setUpdateTime(rs.getDate("update_time"));
        return user;
    }
}
